
import React, { Component } from 'react';
import { recommend_list } from '../../utils/api';
class MySecKill extends Component {
  state = {
    killlist: []
  }
  componentDidMount() {
    recommend_list({ params: { page: 1, count: 6 } }).then((res) => {
      this.setState({
        killlist: res.data.list
      })
    })
  }
  render() {
    return (
      <div className='myseckill'>
        <h2>今日值得买</h2>
        <div className='myseckilll'>
          {
            this.state.killlist.map((item, index) => {
              return (
                <div className='kill' key={index}>
                  <img src={item.pic} alt="" />
                  <div className='killname'>{item.name}</div>
                  <div className='price'>{item.price}</div>
                </div>
              )

            })
          }
        </div>

      </div>
    );
  }
}

export default MySecKill;

